<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        let  data = [
        {
            "score": "100",
            "typeDesc": "",
            "capacityType": 0,
            "levelDesc": "正常",
            "reach": "13.4~18.1",
            "w": "20.8",
            "h": "117",
            "splendid": "13.4~18.1",
            "company": "kg/㎡",
            "healthItemName": "BMI",
            "type": 1,
            "value": "15.2"
        },
        {
            "score": "100",
            "typeDesc": "",
            "capacityType": 0,
            "levelDesc": "优秀",
            "reach": "700",
            "splendid": "1700",
            "company": "毫升",
            "healthItemName": "肺活量",
            "type": 0,
            "value": "1749"
        },
        {
            "score": "80",
            "typeDesc": "柔韧",
            "capacityType": 0,
            "levelDesc": "良好",
            "reach": "0",
            "splendid": "16.1",
            "company": "厘米",
            "healthItemName": "坐位体前屈",
            "type": 0,
            "value": "11"
        },
        {
            "score": "60",
            "typeDesc": "速度",
            "capacityType": 0,
            "levelDesc": "合格",
            "reach": "12.6",
            "splendid": "10.2",
            "company": "秒",
            "healthItemName": "50米",
            "type": 0,
            "value": "12.5"
        },
        {
            "score": "120",
            "typeDesc": "灵敏",
            "capacityType": 0,
            "levelDesc": "优秀",
            "reach": "17",
            "splendid": "109",
            "company": "次",
            "healthItemName": "跳绳",
            "type": 5,
            "value": "150"
        },
        {
            "score": "5",
            "typeDesc": "",
            "capacityType": "",
            "levelDesc": "正常",
            "healthItemName": "裸眼视力",
            "v1": 5.0,
            "type": 3,
            "v2": 5.0,
            "value": "左眼：5.0    右眼：5.0"
        }
    ];
    let tableHead = [
        { name: "类别", props: "typeDesc", width: 50 },
        { name: "项目", props: "healthItemName", width: 100 },
        { name: "成绩", props: "value", width: 140 },
        { name: "达标成绩", props: "reach", width: 160 },
        { name: "满分成绩", props: "splendid", width: 160 },
        { name: "评分", props: "score", width: 65 },
        { name: "评定", props: "levelDesc", width: 85 },
    ]
    data = data.map((item,index)=> {
       
        let obj = {}
        for(let i = 0; i < tableHead.length; i++) {
            let key  = tableHead[i].props
            obj[key] = item[key]
        }

        return obj
    })


    console.log(data)
    </script>
    
</body>
</html>